﻿using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Diagnostics.Metrics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using 紧缩场反射面装调测试系统.Views;

namespace 紧缩场反射面装调测试系统.ViewModels
{
    public partial class MainWindowViewModel : ObservableObject
    {
        /// <summary>
        /// 主页标题
        /// </summary>
        [ObservableProperty]
        private string title = "长屏紧缩场暗室紧缩场反射面装调测试系统";

        /// <summary>
        /// 登录状态
        /// </summary>
        [ObservableProperty]
        private string loginState = "账户未登录";

        /// <summary>
        /// 页面容器
        /// </summary>
        [ObservableProperty]
        private UIElement? page;

        /// <summary>
        /// 当前页面标题
        /// </summary>
        [ObservableProperty]
        private string? currentPageTitle;

        /// <summary>
        /// 页面对象
        /// </summary>
        public ContentControl DirectionalPatternTestPage = new DirectionalPatternTest();
        public ContentControl SpectrumTestPage = new SpectrumTest();
        public ContentControl DataProcessPage = new DataProcess();
        public ContentControl ResultAnalysisPage = new ResultAnalysis();
        public ContentControl SystemSettingPage = new SystemSetting();
        public ContentControl InstrumentSetupPage = new InstrumentSetup();
 

        /// <summary>
        /// 页面导肮
        /// </summary>
        /// <param name="obj"></param>
        [RelayCommand]
        public void NavigationPage(Object obj)
        {
            switch (obj.ToString())
            {
                case "仪器设置":
                    Page = InstrumentSetupPage;
                    CurrentPageTitle = "仪器设置";
                    break;
                case "频谱测试":
                    Page = SpectrumTestPage;
                    CurrentPageTitle = "频谱测试";
                    break;
                case "测方向图":
                    Page = DirectionalPatternTestPage;
                    CurrentPageTitle = "测方向图";
                    break;
                case "数据处理":
                    Page = DataProcessPage;
                    CurrentPageTitle = "数据处理";
                    break;
                case "结果分析":
                    Page = ResultAnalysisPage;
                    CurrentPageTitle = "结果分析";
                    break;
                case "系统设置":
                    Page = SystemSettingPage;
                    CurrentPageTitle = "系统设置";
                    break;
            }
        }


        /// <summary>
        /// 系统初始化
        /// </summary>
        public void Initialize()
        {
            //设置系统起始页面
            NavigationPage(SystemManage.SystemConfig.StartPage);
        }

    }



}
